{layout_title title="Actions map management"}
<link rel="stylesheet" type="text/css" href="{$smarty.const.BASE_URL}/js/flexigrid/css/flexigrid.pack.css">
<script type="text/javascript" src="{$smarty.const.BASE_URL}/js/flexigrid/js/flexigrid.pack.js"></script>
<div id="container">
	<div >
		<table id="actions_map_table" width="99%" border=0 class="actions-map">
			<thead>
				<tr class="">
					<th width=20>No</th>
					<th width=120>Source</th>
					<th width=100>Module</th>
					<th width=100>Action</th>
					<th width=1>View</th>
					<th width=130>Src</th>
					<th width=140>Params Map</th>
				</tr>
			</thead>
			<tbody>
				{assign var=start_index value=1}
				{foreach name=a from=$actions item=action}
				<tr>
					<td class="center">{$start_index}</td>
					<td>
						{$action->name}
						{permissions level=$smarty.const.UILEVEL_PERMISSIONS}
						{if $canManage == 1}
						<a href="{link action=actions_map_edit id=$action->id src=$__loc->src}" title="Edit this entry">
							<img src="{$smarty.const.ICON_RELATIVE}edit.png" title="{$_TR.alt_edit}" alt="{$_TR.alt_edit}" />
						</a>
						<a href="{link action=actions_map_delete id=$action->id src=$__loc->src}" title="Delete this entry">
							<img src="{$smarty.const.ICON_RELATIVE}delete.png" title="{$_TR.alt_delete}" alt="{$_TR.alt_delete}" />
						</a>
						{/if}
						{/permissions}
					</td>
					<td class="center">{$action->module}</td>
					<td class="center">{$action->action}</td>
					<td class="center">{$action->views}</td>
					<td class="center">{$action->src}</td>
					<td class="center">{$action->params_map}</td>
				</tr>     
				{assign var=start_index value=$start_index+1}
				{/foreach}
			</tbody>
		</table> 
	</div>
</div>
<div class="clear"></div>
{literal}
	<script language='javascript'>
		jQuery('#actions_map_table').flexigrid({
			height:'auto',
            width: '600',
			striped:true,
			usepager : true,
			resizable: false,
			novstripe: true,
			//title : 'Countries',
			useRp : true,
			rp : 15,
			showTableToggleBtn : false,
			buttons : [ {/literal}
            {permissions level=$smarty.const.UILEVEL_PERMISSIONS}  
                {if $canManage == 1}
                    {ldelim}
                        name : 'Add',
                        bclass : 'add',
                        onpress : AB_PDoremiShop_ActionMap_addNew
                    {rdelim},  
                {/if}
            {/permissions}
            ],
			
		{rdelim});
		{permissions level=$smarty.const.UILEVEL_PERMISSIONS}  
                {if $canManage == 1} {literal}
		function AB_PDoremiShop_ActionMap_addNew(com, grid) {
			if (com == 'Add') {
				window.location='{/literal}{link action=actions_map_edit}{literal}';
			}
		} {/literal}
        {/if}
        {/permissions}
	</script>
{/literal}